<template>
  <div class="default-main ba-table-box">
    <div class="block">
      <div class="table-block">
        <el-alert class="ba-table-alert"
                  v-if="baTable.table.remark"
                  :title="baTable.table.remark"
                  type="info"
                  show-icon />
        <!-- 表格顶部菜单 -->
        <TableHeader :buttons="['refresh', 'add', 'edit', 'delete', 'comSearch', 'quickSearch', 'columnDisplay']"
                     :quick-search-placeholder="t('Quick search placeholder', { fields: '订单号' })">
        </TableHeader>

        <!-- </template> -->
        <Table></Table>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive, provide } from 'vue'
import baTableClass from '/@/utils/baTable'
// import PopupForm from './popupForm.vue'
import Table from '/@/components/table/index.vue'
import TableHeader from '/@/components/table/header/index.vue'
import { baTableApi } from '/@/api/common'
// import { fileUpload, exportExcel } from '/@/api/backend/warehouse/warehouseList'
import Cookies from 'js-cookie'
import { useI18n } from 'vue-i18n'

defineOptions({
    name: 'warehouse/totalinventory',
})
const { t } = useI18n()
const state: {
    buttonLoading: boolean
} = reactive({
    buttonLoading: false
})

const baTable = new baTableClass(
    new baTableApi('/warehouse/totalinventory/'),
    {
        column: [
            {   
                label: 'sku', 
                prop: 'sku_info', 
                align: 'center',
                operatorPlaceholder: t('Please input field')
            },
            {   
                label: '总库存数', 
                prop: '总库存数', 
                align: 'center',
                operator: false
            },
            {   
                label: '总占用库存数', 
                prop: '总占用库存数', 
                align: 'center',
                operator: false
            },
            {   
                label: '总可用库存数', 
                prop: '总可用库存数', 
                align: 'center',
                operator: false
            }
        ],
        dblClickNotEditColumn: ['all']
    },
    {
        defaultItems: {
            status: '1',
        }
    }
)

provide('baTable', baTable)

baTable.mount()
baTable.getIndex()

</script>

<style scoped lang="scss">
</style>
